package com.demo.boss.common.convert;

import com.demo.boss.entity.PayWay;
import com.demo.boss.models.vo.PayWayVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,uses = {MapperHelper.class})
public interface PayWayConvert {
    @Mappings({
        @Mapping(source = "wayCode",target = "wayCode"),
        @Mapping(source = "wayName",target = "wayName"),
        @Mapping(source = "typeCode",target = "typeCode"),
        @Mapping(source = "typeName",target = "typeName"),
        @Mapping(source = "payProductCode",target = "productCode"),
        @Mapping(source = "payRate",target = "payRate"),
        @Mapping(source = "sorts",target = "sorts"),
        @Mapping(source = "status",target = "status",qualifiedByName = "translateStatus"),
        @Mapping(source = "editTime",target = "editTime",dateFormat = "yyyy-MM HH:mm"),
    })
    PayWayVo mapPayWay(PayWay payWay);
    List<PayWayVo> payWayVoList(List<PayWay> payWays);
}
